<!DOCTYPE html>
<html lang="en">
	<head>
		<title> New Document </title>
		<meta charset="utf-8">
		<meta name="Author" content="">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<!-- Bootstrap -->
		<link href="${webRoot}resources/css/bootstrap.min.css" rel="stylesheet" media="screen">
		<link href="${webRoot}resources/css/style.css" rel="stylesheet">
		<script src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
	</head>
<body class="main">
	<div class="wrap add-shop">
	<ul class="breadcrumb">
		    <li><span id="test">您当前的位置：</span></li>
		    <li class="active">${updateShop}</li>
	    </ul>
		<form class="form-horizontal" method="post"
			enctype="multipart/form-data"
			action="${webRoot}shop/updateShop.do" id="goodsInfo">
		  <input type="hidden" id="id" name="id" value="${shopEntity.id}">
		  <div class="control-group">
		    <label class="control-label" for="name">商家名称</label>
		    <div class="controls">
		      <input type="text" id="name" name="name" value="${shopEntity.name}">
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" for="lon">商家经度</label>
		    <div class="controls">
		      <input type="text" id="lon" name="lon" value="${shopEntity.lon}">
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" for="lat">商家纬度</label>
		    <div class="controls">
		      <input type="text" id="lat" name="lat" value="${shopEntity.lat}">
		    </div>
		  </div>
		   <div class="control-group">
		    <label class="control-label" for="devel">商家等级</label>
		    <div class="controls">
		      <input type="number" id="devel" name="devel" value="${shopEntity.devel}">
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" for="telephone">联系电话</label>
		    <div class="controls">
		      <input type="text" id="telephone" name="telephone" value="${shopEntity.telephone}">
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" for="address">商家地址</label>
		    <div class="controls">
				<!--<select class="w120" id="goods_citycode" name="goods_citycode">
				  <option value="0128">宜兴</option>
				</select>
				<select class="w120" id="goods_areacode" name="goods_areacode">
				  <#list listArea as areaEntity>
				  <option value="${areaEntity.areacode}">${areaEntity.areaname}</option>
				 </#list>
				</select>
				--><input type="text" id="address"  name="address" value="${shopEntity.address}">				
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" for="content">商家简介</label>
		    <div class="controls">
		      <textarea rows="3" id="content" name="content">${shopEntity.content}</textarea>
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" for="isauth">是否认证</label>
		    <div class="controls">
		     <select class="w120" id="isauth" name="isauth">
				   <#if shopEntity.isauth=="Y">
				  		<option value="Y" selected="selected">是</option>
				  		<option value="N">否</option>
				  <#else>
				  		<option value="N"  selected="selected">否</option>
				  		<option value="Y">是</option>
				  </#if>
				</select>
		    </div>
		  </div>
		   <input type="hidden" id="logo" name="logo" value="${shopEntity.logo}"/>
		  <div class="control-group">
				<label class="control-label" for="file">商家logo</label>
				<div class="controls">
					<input type="file" id="file" name="file">
					<div class="preview">
						<img src="${shopEntity.logo}">
					</div>
				</div>
			</div>  		    
		  <div class="control-group">
		    <div class="controls">
		      <button type="button" class="btn" onclick="checkContext()">确认添加</button>
		    </div>
		  </div>
		</form>			 	
	</div>			
	<script src="${webRoot}resources/js/jquery-1.9.1.min.js"></script>
	<script src="${webRoot}resources/js/bootstrap.min.js"></script>
	<script src="${webRoot}resources/js/js.js"></script>
    <script type="text/javascript">
    function checkContext(){
    	var goodsName = $("#name").val();
    	if($.trim(goodsName) == null ||$.trim(goodsName) =="" ){
    		alert("商铺名字不能为空！");
    		return;
    	}
    	var goodsJingdu= $("#lon").val();
    	if($.trim(goodsJingdu) == null ||$.trim(goodsJingdu) =="" ){
    		alert("商铺经度不能为空！");
    		return;
    	}
    	var goodsWeiDu= $("#lat").val();
    	if($.trim(goodsWeiDu) == null ||$.trim(goodsWeiDu) =="" ){
    		alert("商铺纬度不能为空！");
    		return;
    	}
    	var uplabelId= $("#devel").val();
    	if($.trim(uplabelId) == null ||$.trim(uplabelId) =="" ){
    		alert("商铺等级不能为空！");
    		return;
    	}
    	var goodstelephone= $("#telephone").val();
    	if($.trim(goodstelephone) == null ||$.trim(goodstelephone) =="" ){
    		alert("联系电话不能为空！");
    		return;
    	}
    	file
    	var goodsAddress= $("#address").val();
    	if($.trim(goodsAddress) == null ||$.trim(goodsAddress) =="" ){
    		alert("商铺的详细地址不能为空！");
    		return;
    	}
    	var goods_Desc= $("#content").val();
    	if($.trim(goods_Desc) == null ||$.trim(goods_Desc) =="" ){
    		alert("商铺的简介不能为空！");
    		return;
    	}
    	document.getElementById("goodsInfo").submit();
    }
    </script>

</body>
</html>
